<?php
	
	if(isset($_POST['submit'])){
		updateConfig(1,$_POST['title']);
		updateConfig(2,$_POST['fotter']);
		updateConfig(3,$_POST['logo']);
		updateConfig(11,$_POST['website']);
		updateConfig(5,$_POST['company']);
		updateConfig(6,$_POST['address']);
		updateConfig(7,$_POST['tel']);
		updateConfig(8,$_POST['phone']);
		updateConfig(9,$_POST['fax']);
		updateConfig(19,$_POST['email']);
		updateConfig(4,$_POST['yahoo']);
		updateConfig(10,$_POST['skype']);
		updateConfig(17,$_POST['lock_mem_reg']);
		updateConfig(18,$_POST['keyword']);
		if($_POST['lock'] == 1){
			updateConfig(12,$_POST['content_lock']);
		}
		updateConfig(13,$_POST['p_product']);
		updateConfig(14,$_POST['p_raovat']);
		updateConfig(15,$_POST['p_tuyendung']);
		updateConfig(16,$_POST['p_tintuc']);
		Redirect("Cập nhật thành công","?mod=config");
	}

?>

<form name="frmConfig" action="" method="post">
<table width="100%" border="1" bordercolor="#B2DAEE" cellpadding="4">
		<tr class="newsList-content-head">
		<td height="19" colspan="2" align="center">
			&nbsp;<font face="Verdana, Arial" color="#FF0000"><strong>Cấu hình Website</strong></font>		</td>
	</tr>	
	    <tr>
	      <td align="right">Nội dung Title </td>
	      <td><input name="title" type="text" id="title" size="50" value="<?=loadConfig(1)?>" /> 
	        (*) </td>
    </tr>
	    <tr>
	      <td align="right">Nội dung Fotter </td>
	      <td><input name="fotter" type="text" id="fotter" size="50" value="<?=loadConfig(2)?>"/> 
	        (*) </td>
    </tr>
	    <tr>
	      <td align="right">Logo </td>
	      <td><input name="logo" type="text" id="logo" size="50" value="<?=loadConfig(3)?>"/> 
	        (*) </td>
    </tr>
	    <tr>
	      <td align="right">Website </td>
	      <td><input name="website" type="text" id="website" size="50" value="<?=loadConfig(11)?>" /> 
          (*) </td>
    </tr>
	    <tr>
	      <td align="right">Tên công ty </td>
	      <td><input name="company" type="text" id="company" size="50" value="<?=loadConfig(5)?>"/></td>
    </tr>
	    <tr>
	      <td align="right">Địa chỉ </td>
	      <td><input name="address" type="text" id="address" size="50" value="<?=loadConfig(6)?>"/></td>
    </tr>
	    <tr>
	      <td align="right">Điện thoại </td>
	      <td><input name="tel" type="text" id="tel" size="50" value="<?=loadConfig(7)?>"/></td>
    </tr>
	    <tr>
	      <td align="right">Phone </td>
	      <td><input name="phone" type="text" id="phone" size="50" value="<?=loadConfig(8)?>" /></td>
    </tr>
	    <tr>
	      <td align="right">Fax </td>
	      <td><input name="fax" type="text" id="fax" size="50" value="<?=loadConfig(9)?>"/></td>
    </tr>
	    <tr>
	      <td align="right">Email </td>
	      <td><input name="email" type="text" id="email" size="50" value="<?=loadConfig(19)?>"/></td>
    </tr>
	    <tr>
	      <td align="right">Yahoo </td>
	      <td><input name="yahoo" type="text" id="yahoo" size="50" value="<?=loadConfig(4)?>"/></td>
    </tr>
	    <tr>
	      <td align="right">Skype </td>
	      <td><input name="skype" type="text" id="skype" size="50" value="<?=loadConfig(10)?>"/></td>
    </tr>
	    <tr>
	      <td align="right">Khóa đăng kí thành viên </td>
	      <td><input name="lock_mem_reg" type="checkbox" id="lock_mem_reg" value="1" maxlength="250" <? if(loadConfig(17) == 1){ ?> checked="checked" <? } ?>/></td>
    </tr>
    <tr>
		<td width="25%" align="right">Khóa Website</td>
		<td width="75%">
		<input name="lock" type="checkbox" id="lock" value="1" maxlength="250" <? if(loadConfig(12) != ""){ ?> checked="checked" <? } ?>/>	  </td>
	</tr>
	<tr>
		<td align="right">Thông báo khóa Website</td>
		<td>
		<textarea name="content_lock" cols="50" rows="5" id="content_lock" ><?=loadConfig(12)?></textarea> Max: 250 ký tự	  </td>
	</tr>
	<tr>
		<td align="right">Từ khóa Website</td>
		<td>
		<textarea name="keyword" cols="50" rows="5" id="keyword"><?=loadConfig(18)?></textarea> Max: 250 ký tự	  </td>
	</tr>
	<tr>
      <td align="right">Số sản phẩm trên 1 trang</td>
	  <td><input name="p_product" type="text" id="p_product" size="10" maxlength="250" value="<?=loadConfig(13)?>"/>      </td>
    </tr>
	<tr>
	  <td align="right">Số rao vặt trên 1 trang</td>
	  <td>
		<input name="p_raovat" type="text" id="p_raovat" size="10" maxlength="250" value="<?=loadConfig(14)?>">	  </td>
	</tr>
	<tr>
      <td align="right">Số tuyển dụng trên 1 trang</td>
	  <td><input name="p_tuyendung" type="text" id="p_tuyendung" size="10" maxlength="250" value="<?=loadConfig(15)?>"/>      </td>
    </tr>
	<tr>
      <td align="right">Số tin tức trên 1 trang</td>
	  <td><input name="p_tintuc" type="text" id="p_tintuc" size="10" maxlength="250" value="<?=loadConfig(16)?>"/>      </td>
    </tr>
    <tr>
		<td colspan="2" align="center">
		<input type="submit" name="submit" value="Lưu lại" class="Button">&nbsp;&nbsp;&nbsp;
		<input type="reset" name="reset" value="Làm lại" class="Button"></td>
	</tr>
</table>
</form>